<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>账户管理</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="//staticnew.mayi.com/resourcesWeb/css/global.css?V=201508071525" rel="stylesheet" type="text/css" />
<link href="//staticnew.mayi.com/resourcesWeb/css/PCenter.css?V=20160715" rel="stylesheet" type="text/css" />

<script type="text/javascript">
	$(function(){
		var CenterTab = $('.centerTab li')
			CenterTab.each(function(e){
			CenterTab.eq(e).click(function(){
				$(this).addClass('active').siblings().removeClass('active');
				$('.MtList').eq(e).show().siblings().hide();
				$(".discountManageUl a").removeClass("on").eq(e).addClass("on");
			});
		});
		//添加账号切换效果
		$('.add-con ul:first').show();
		$('.add-account a').each(function(e){
			$('.add-account a').eq(e).click(function(){
				$(this).addClass('addcurrent').siblings().removeClass('addcurrent');
				$('.add-con').children('ul').eq(e).show().siblings().hide();
				return false;
			});
		});
		
		$('#papertype').change(function(){
			if($(this).val()==414 ){
				$('#countryli').css('display','block');
				var country = $('#country').val();
				if(country==1){
					$('#nationli').css('display','block');
					//$('#locationli').css('display','block');
					$('#housetownli').css('display','block');
				}else{
					$('#nationli').css('display','none');
				}
			}else{
				$('#countryli').css('display','none');
				$('#nationli').css('display','block');
				//$('#locationli').css('display','block');
				$('#housetownli').css('display','block');
			}
		});
		
		$('#country').change(function(){
			if($(this).val()==1||$(this).val()==0){
				$('#nationli').css('display','block');
				//$('#locationli').css('display','block');
				$('#housetownli').css('display','block');
			}else{
				$('#nationli').css('display','none');
				//$('#locationli').css('display','none');
				$('#housetownli').css('display','none');
			}
		});
		
		$(".discountManageUl a").click(function(){
			var Index=$(this).index();
			$(this).siblings("li").removeClass("on");
			$(this).addClass("on");
			$(".centerTab li").eq(Index).click();
			//event.stopPropagation();
			//return false;
		})
		
		$(".settlement_way").click(function(){
			$(".discountManageUl a").eq(1).click();
		})
		
		$(".discountManageUl a").eq(0).addClass("on");
	});
	  
</script>

</head>

<body>
<!-- Content -->
<div class="main">
	<ul class="breadcrumb clearfix">
		<li><a href="jsp/myOrders.jsp">我是房客</a> <span
			class="divider">》</span></li>
		<li>账户管理</li>
	</ul>

	<div class="personalCenter clearfix">
		<!-- Center-sidebar -->
		<ul class="center-sidebar">
			<li><a href="jsp/myOrders.jsp">订单管理<span
					class="ddgl"></span></a></li>
			<li><a href="jsp/myMassage.jsp">消息通知<span
					class="xxtz"></span></a></li>
			<li><a class="slideactive" href="jsp/myInfo.jsp">账户管理<span
					class="zhgl_current"></span></a></li>
			<li><a href="jsp/myCollection.jsp">我的收藏<span
					class="save_Li"></span></a></li>

		</ul>
		
		<!-- Center-sidebar END -->
		<div class="centerCon">
			<ul class="centerTab">
				<li class="active">个人信息</li>
				<li>密码设置</li>
			</ul>
			<div class="accountMt clearfix">
			
				<!-- 个人信息 -->
				<input type="hidden" name="issetpass" id="issetpass" value="false" />
				<input type="hidden" name="isbandmobile" id="isbandmobile"
					value="false" /> <input type="hidden" name="usertype"
					id="usertype" value="tenant" /> <input type="hidden"
					name="bjlandlord" id="bjlandlord" value="0" />
				<div class="MtList" style="display:block;">
					<div class="avatar-box">
						<div class="avatar" id="headimage_div">
							<img id="headImg" style="width:100px;height:100px;"
								src="https://i1.mayi.com/gjfs15/M06/C7/19/CgEHQFcxdRfgpEk7AABlcbtch,g688.jpg_240x240c.jpg"
								alt="" />
						</div>
						<p>
							<a id="upheadimgdo" class="alertAvatar" rel="nofollow"
								href="javascript:void(0)">[修改头像]</a>
						</p>

					</div>
					<div class="tabCon">
						<ul class="userInfo">
							<!-- 用户ID -->
							<li class="clearfix"><span class="infoTitle">用&nbsp;户&nbsp;名：</span><span id="userId">1</span></li>
							<!-- 昵称 -->
							<li class="clearfix"><span class="infoTitle">昵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</span>
								<input class="personLargeInput" type="text" name="nickName" id="nickName" value="" /></li>
							<!-- 真实姓名 -->
							<li class="clearfix"><span class="infoTitle">真实姓名：</span> 
							<input class="personLargeInput" type="text" name="realName" id="realName" value="" /> 
							</li>
							<!-- 身份证号 -->
							<li class="clearfix"><span class="infoTitle">身份证号：</span>
								<input class="personLargeInput" type="text" name="cardId"
								id="cardId" value="" /> 
							</li>
							<!-- 性别 -->
							<li class="clearfix"><span class="infoTitle">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</span>
								<select class="ccitySelect" id="sex" name="sex">
									<option value="">-请选择-</option>
									<option value="男">男</option>
									<option value="女" selected="selected">女</option>
								</select>
							</li>
							<!-- 年龄 -->
							<li class="clearfix"><span class="infoTitle">年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄：</span>
								<input class="personLargeInput" type="text" name="age" id="age" value="" /> 
							</li>
							<!-- 邮箱 -->
							<li class="clearfix"><span class="infoTitle">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱：</span>
								<input class="personLargeInput" type="text" name="email" id="email" value="" /> 
							</li>
							<!-- 手机号 -->
							<li class="clearfix" id="mobile_div">
								<span class="infoTitle">手机号码：</span> 
								<input class="personLargeInput" type="text" name="mobile" id="mobile" value="" style="color:#000;" /> 
								<i class="code-i" id="code" name="code" code="86">+86</i>
							</li>
							
						</ul>
						<div class="submit-wrap">
							<a id="saveuser" class="save-btn" rel="nofollow"
								href="javascript:void(0)" onclick="upMyInfo()">保存</a>
						</div>
					</div>
				</div>
				<!-- 个人信息 END -->


				<!-- 密码设置 START -->
				<div class="MtList">
					<input type="hidden" name="issetpass" id="issetpass" value="false" />
					<input type="hidden" name="isbandmobile" id="isbandmobile"
						value="false" />
					<ul class="userInfo">
						<li class="clearfix"><span class="infoTitle">用
								&nbsp;户&nbsp;名：</span> #t_867299774</li>
						<li class="clearfix"><span class="infoTitle">输入密码：</span> <input
							type="password" value="" name="newpass" id="newpass"
							class="personLargeInput" /> <span class="prompt"
							id="newpassspan" name="newpassspan">6-16个字符</span></li>
						<li class="clearfix"><span class="infoTitle">确认密码：</span> <input
							type="password" value="" name="repass" id="repass"
							class="personLargeInput" /> <span class="prompt" id="repassspan"
							name="repassspan">重复输入一次密码</span> 
						</li>
					</ul>
					<div class="submit-wrap">
						<a class="save-btn" id="savepassbtn" name="savepassbtn"
							rel="nofollow" href="javascript:void(0)" onclick="changePassword()">保存</a>
					</div>
				</div>
				<!-- 密码设置 END-->


			</div>
		</div>
	</div>
</div>
<!-- Content END -->
<script type="text/javascript" src="<%=basePath%>/js/public/jquery-1.11.0.min.js"></script>
<script type="text/javascript" >
	function upMyInfo(){
	$.ajax({
		url : "UpMyInfo.action",
		type : "post",
		dataType:"json",
		data : {
			 userId : $("#userId").html(),  //用户ID
			 nickName :$("#nickName").val(), 
			 realName :$("#realName").val(), 
			 cardId :$("#cardId").val(), 
			 sex :$("#sex").val(), 
			 age :$("#age").val(), 
			 email :$("#email").val(), 
			 mobile :$("#mobile").val()
		},
		success : function(result) {
			alert(result);//提示修改成功
		}
	});
}


function showMyInfo(){
	$.ajax({
		url : "ShowMyInfo.action",
		type : "post",
		dataType:"json",
		data : {
			 userId : $("#userId").html(),  //用户ID
		},
		success : function(data) {
			$("#nickName").val(data.u_nickName);
			$("#realName").val(data.u_name);
		/* 	$("#sex").html(data.u_sex);  */
			$("#age").val(data.u_age);
			$("#mobile").val(data.u_phoneNum);
			$("#email").val(data.u_email); 
			$("#cardId").val(data.u_cardId); 
			
		}
	});
}
showMyInfo();
</script>

	
</body>

</html>
